package com.ssy.lingxi.platform.manage.repository;

import com.ssy.lingxi.platform.manage.entity.base.ShopRule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShopRuleRepository extends JpaRepository<ShopRule, Long>, JpaSpecificationExecutor<ShopRule> {

    ShopRule findByMemberIdAndMemberRoleIdAndStatus(Long memberId, Long memberRoleId, Integer status);

    List<ShopRule> findByMemberIdInAndStatus(List<Long> memberIdList, Integer status);

    int countByMemberId(Long memberId);

    List<ShopRule> findByStatus(Integer status);
}
